package com.lantosec.hmrp.modules.workflow.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskInfo;
import org.flowable.task.api.history.HistoricTaskInstance;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "FlowTaskVO对象", description = "流程节点对象的信息")
public class FlowTaskVO {

    public FlowTaskVO(TaskInfo entity){
        assignee = entity.getAssignee();
        createTime = entity.getCreateTime();
        description = entity.getDescription();
        owner = entity.getOwner();
        processDefinitionId = entity.getProcessDefinitionId();
        processInstanceId = entity.getProcessInstanceId();
        taskDefinitionKey = entity.getTaskDefinitionKey();
        taskId = entity.getId();
        taskName = entity.getName();
    }

    @ApiModelProperty(value = "任务ID")
    private String taskId;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    @ApiModelProperty(value = "任务描述")
    private String description;

    @ApiModelProperty(value = "操作人")
    private String assignee;

    @ApiModelProperty(value = "操作人名称")
    private String assigneeName;

    @ApiModelProperty(value = "所属人")
    private String owner;

    @ApiModelProperty(value = "任务定义Key")
    private String taskDefinitionKey;

    @ApiModelProperty(value = "流程实例Id")
    private String processInstanceId;

    @ApiModelProperty(value = "流程实例名称")
    private String processName;

    @ApiModelProperty(value = "流程定义Id")
    private String processDefinitionId;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "查看时间")
    private Date lookTime;
}
